package com.k.demo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.k.demo.entity.ShoppingCart;
import com.k.demo.entity.ShoppingCartDetail;
import com.k.demo.mapper.FoodMapper;
import com.k.demo.mapper.ShoppingCartMapper;
import com.k.demo.service.ShoppingCartService;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {
	@Autowired
	private ShoppingCartMapper mapper;

	@Override
	public ShoppingCart getCart(int userID) {
		
		return mapper.selectCartByUserID(userID);
	}

	@Override
	public boolean insertShoppingCart(int user_id) {
		
		return mapper.insertShoppingCart(user_id)>0;
	}

	@Override
	public ShoppingCart simSelect(int userID) {
	
		return mapper.simpleSelectByUserID(userID);
	}
}

